package com.jackiechan.day13;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class LianXi {
    public static void main(String[] args) throws IOException {
//        copy();
//        File file = new File("E:\\360Downloads - 副本");
//        del(file);
        rR();
    }

    private static void del(File file) {
        if (!file.delete()) {
            File[] files = file.listFiles();
            for (int i = 0; i < files.length; i++) {
                del(files[i]);
            }
            file.delete();
        }
    }

    private static void copy() throws IOException {
        InputStream in = new FileInputStream("E:\\360Downloads");
        OutputStream out = new FileOutputStream("E:\\360Downloads - 副本");
        int i = 0;
        while ((i = in.read()) != -1) {
            out.write(i);
        }
        in.close();
        out.close();
        System.out.println("复制完成");
    }

    private static void rR() throws IOException {
        InputStream in = new FileInputStream("E:\\1.txt");
        List list = new ArrayList();
        int b = 0;
        while ((b = in.read()) != -1) {
            if (!list.contains((char) b)) {
                list.add((char) b);
            }
        }
        in.close();
        System.out.println(list);
    }


}
